# 设置代码页为UTF-8，正常显示中文
# -*- coding: UTF-8 -*-

import pygame
from scenes import GameMetaData, TitleScene, Scenes
from shape import *
import os

#########
# 时 钟 #
#########
clock = pg.time.Clock()

# 设置窗口居中显示
os.environ['SDL_VIDEO_WINDOW_POS'] = '1'
main_screen = pg.display.set_mode((GameMetaData.screen_width, GameMetaData.screen_height))
pg.display.set_caption("俄罗斯方块游戏V1.4")

Scenes.titleScene = TitleScene()
Scenes.active_scene = Scenes.titleScene

while True:
    Scenes.active_scene.process_input(pg.event.get())
    Scenes.active_scene.update()
    Scenes.active_scene.render(main_screen)

    clock.tick(50)    
